{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>欢迎登录实验室管理系统</title>

    <!-- 新 Bootstrap4 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
    <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <!-- 移动设备优先 -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script>
        <!-- 判断两个input标签内的密码是否一致 -->
        function check2pwd()
        {
            if (new_password1.value !== new_password2.value)
            {
                alert("两次输入密码不一致！")
            }
        }
    </script>
    <style>
        body {
            background-image: url({% static 'images/seu1.jpg' %});
            background-size: cover;
        }

        .middle {
            margin-top: 110px;
            margin-bottom: 110px;
            padding: 100px 50px 50px 50px;
            background-color: white;
            border-radius: 15px;
            box-shadow: 10px 10px 5px rgb(0, 0, 0);
        }

        .login {
            margin-left: 20px;
        }

        .btn {
            border-radius: 28px;
        }

        .img {
            object-fit: cover;
            display: flex;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="middle mx-auto h-75 w-75">
        <div class="row">
            <div class="col col-12 col-md-6">
                <img class="rounded img-fluid img" src={% static 'images/logo2.png' %}>
            </div>
            <div class="col col-12 col-md-6">
                <div class="login">
                    <h3 class="font-weight-bold">欢迎登陆实验室管理系统!</h3>
                    <form action="" method="post">
                        {% csrf_token %}
                        <div class="form-group">
                            <input type="text" class="form-control" id="username" name="username" required="required"
                                   placeholder="用户名">
                        </div>
                        <div class="form-group">
                            <input type="password" class="form-control" id="old_password" name="old_password"
                                   required="required"
                                   placeholder="原密码">
                        </div>
                        <div class="form-group">
                            <input type="password" class="form-control" id="new_password1" name="new_password1"
                                   required="required"
                                   placeholder="新密码">
                        </div>
                        <div class="form-group">
                            <input type="password" class="form-control" id="new_password2" name="new_password2"
                                   required="required" onblur="check2pwd()"
                                   placeholder="再次输入密码">
                        </div>
                        <span class="mx-auto" style="color:red;">{{ error_msg }}</span>
                        <br/><br/>
                        <button type="submit" class="btn btn-primary btn-block w-75 mx-auto" id="change_password">提 交
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>